<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreUserPost extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'username' => 'required',
            'password' => 'required|same:confirm_password',
            'confirm_password' => 'required',
            'role_id' => 'required',            
        ];
    }
	
	public function messages(){
		return [
			'username.required' => '用户名必须输入！',
			'password.required' => '密码必须输入！',
		];
	}
}
